package utils;

public class TokenUtil {

    public static String getTokenByAuthorization(String authorization,String token){
        String token1 = authorization;
        String tokenHead = "Bearer ";
        if(token1 == null) {
            token1 = token;
        } else if(token1.contains(tokenHead)){
            token1 = token1.substring(tokenHead.length());
        }
        if("".equals(token1)) {
            token1 = null;
        }
        return token1;
    }
}
